package com.doit.day03

//在scala里面实现特质，用extends
class SuperDog extends Fly with Jump{
  def eat() = {
    println("eat shit!!!")
  }

  override def fly(): Unit = println("我坐飞机会飞，其实我不会飞！！！")

  override def jump(): Unit = println("跳还是没问题的！！！")
}

object _抽象类测试_{
  def main(args: Array[String]): Unit = {
    val dog: SuperDog = new SuperDog
    dog.fly()


    //特质的动态混入
    val xiaoTianQuan: SuperDog with Cosplay = new SuperDog with Cosplay {
      override def bianBianBian(): Unit = println("变出来一坨自己猜！！！")
    }
    xiaoTianQuan.bianBianBian()

  }
}
